//
//  ShopUserInfoTableViewController.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/8.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "ShopUserInfoTableViewController.h"
#import "UIImage+Circle.h"
#import "SaveListTableViewController.h"
#import "AddressManagerTableViewController.h"
#import "RuleTableViewController.h"

@interface ShopUserInfoTableViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *head;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UIButton *level;
@property (weak, nonatomic) IBOutlet UIButton *integral;
@property (weak, nonatomic) IBOutlet UIImageView *order;
@property (weak, nonatomic) IBOutlet UIImageView *collect;
@property (weak, nonatomic) IBOutlet UIImageView *address;
@property (weak, nonatomic) IBOutlet UIImageView *moneyIntegral;
@property (weak, nonatomic) IBOutlet UIImageView *pay;
@property (weak, nonatomic) IBOutlet UIImageView *dispatchGoods;
@property (weak, nonatomic) IBOutlet UIImageView *consignee;
@property (weak, nonatomic) IBOutlet UIImageView *allOrder;

@end

@implementation ShopUserInfoTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //背景图
    self.bgView.image = [UIImage imageNamed:@"bg.png"];
    //头像图片
    self.head.image = [UIImage imageWithIconName:@"headDefault.png" border:1 borderColor:[UIColor whiteColor]];
    //按钮圆角设置
    self.level.layer.masksToBounds = YES;
    self.level.layer.cornerRadius = 5.0f;
    self.integral.layer.masksToBounds = YES;
    self.integral.layer.cornerRadius = 5.0f;
    //订单图片
    self.order.image = [UIImage imageNamed:@"order.png"];
    //收藏图片
    self.collect.image = [UIImage imageNamed:@"collect.png"];
    //收货地址图片
    self.address.image = [UIImage imageNamed:@"address.png"];
    //积分兑换规则
    self.moneyIntegral.image = [UIImage imageNamed:@"moneyIntegral.png"];
    //待付款图片
    self.pay.image = [UIImage imageNamed:@"pay.png"];
    //待发货图片
    self.dispatchGoods.image = [UIImage imageNamed:@"dispatchGoods.png"];
    //待收货图片
    self.consignee.image = [UIImage imageNamed:@"consignee.png"];
    //全部订单图片
    self.allOrder.image = [UIImage imageNamed:@"allOrder.png"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    if (indexPath.section == 1) {
        if (indexPath.row == 0) {
            SaveListTableViewController *saveList = [storyBoard instantiateViewControllerWithIdentifier:@"SaveListTableViewController"];
            [self presentViewController:saveList animated:YES completion:nil];
        }else if (indexPath.row == 1)
        {
            AddressManagerTableViewController *addAddress = [storyBoard instantiateViewControllerWithIdentifier:@"AddressManagerTableViewController"];
            [self presentViewController:addAddress animated:YES completion:nil];
        }else
        {
            RuleTableViewController *rule = [storyBoard instantiateViewControllerWithIdentifier:@"RuleTableViewController"];
            [self presentViewController:rule animated:YES completion:nil];
        }
    }
}

@end
